package com.kylin.dal.entity.commodity;

import com.kylin.shared.common.entity.BaseEntry;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import javax.persistence.*;
import java.io.Serializable;

/**
 * 商品基本信息
 * @author Damon S.
 * @version v1.0.1
 * @date 2019年11月24日 19:24
 */
@Entity
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_commodity_main", catalog = "db_kylin_artwork")
public final class CommodityEntry extends BaseEntry implements Serializable {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long commodityId;

    @Column private String code;
    @Column private String title;
    @Column private String subtitle;
    @Column private Integer inventory;
    @Column private Long price;

    @Column(name = "cover_url")
    private String cover;

    @Column(name = "merchant_id")
    private Long merchantId;

    @Column(columnDefinition = "TINYINT")
    private Integer state;

    @Column(columnDefinition = "BIT")
    private Integer removed;

    @Column(columnDefinition = "BIT")
    private Integer shelved;

    @Column(name = "created_by", updatable = false, nullable = false)
    private Long createdBy;

    @Column(name = "updated_by", updatable = false, nullable = false)
    private Long updatedBy;

    @Column(name = "removed_by")
    private Long removedBy;

    @Column(name = "putoff_at")
    private Long putOffAt;

    @Column(name = "shelved_at")
    private Long shelvedAt;

    @Column(name = "approved_at")
    private Long approvedAt;

    @Column(name = "refused_at")
    private Long refusedAt;

    @Column(name = "created_at")
    private Long createdAt;

    @Column(name = "updated_at")
    private Long updatedAt;

    @Column(name = "removed_at")
    private Long removedAt;
}
